#include "string.hpp"

void Test1()
{
    ns_string::string s((char*)"hello");
    cout << "s = " << s << endl;
    ns_string::string copy_s(s);
    cout << "copy_s = " << copy_s << endl;

    ns_string::string ns((char*)"you are right");
    s = ns;
    cout << "s = " << s << endl;
}

void Test2()
{
    ns_string::string s;
    s.push_back('a');
    s.push_back('b');
    s.push_back('c');
    s.push_back('d');
    s.push_back('c');
    cout << s << endl;

    s.append("efg");
    s.append("ojk");
    cout << s << endl;

    s.insert(3, "bbb");
    s.insert(5, "aaa");
    cout << s << endl;
}

void Test3()
{
    ns_string::string s((char*)"abcdefghk");

    cout << s.find('d') << endl;
    
    s.erase(3, 5);
    cout << s << endl;

    s.pop_back();
    s.pop_back();
    cout << s << endl;
}

void Test4()
{
    ns_string::string s((char*)"hello world");
    cout << s.c_str() << endl;
}

void Test5()
{
    ns_string::string s1((char*)"hello worla");
    ns_string::string s2((char*)"hello world");
    cout << (s1 > s2) << endl;
}

int main()
{
    //Test1();
    //Test2();
    //Test3();
    //Test4();
    Test5();

    return 0;
}